package cn.lf.utils;

import org.springframework.util.DigestUtils;

public class PasswordUtils {

    /**
     * 随机盐值
     */
    private static final String salt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

    public static String encrypt(String password){

        String saltPassword = DigestUtils.md5DigestAsHex((salt + password).getBytes());

        return saltPassword;

    }

    public static void main(String[] args) {
        String st = "123456";
        final String encrypt = encrypt(st);
        System.out.println(encrypt);

    }

}
